package com.netease.b.b.b;

import com.netease.a.b.h;
import com.netease.b.b.e.f;
import com.netease.b.b.e.k;
import com.netease.framework.a.m;
import com.netease.pris.a.i;
import com.netease.pris.c.l;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Hashtable;
import org.json.JSONException;
import org.json.JSONObject;

public class c extends k
{
  private static final String a = "/statuses/upload.json";
  private static final String b = "/statuses/update.json";
  private String j;
  private String k;
  private String l;
  private m m;

  protected c(int paramInt)
  {
    super(paramInt);
  }

  public static com.netease.framework.b.a a(String paramString1, String paramString2, String paramString3)
  {
    int i = 4097;
    if (!i.e(paramString3))
      i = 4098;
    c localc = new c(i);
    localc.k = paramString3;
    localc.j = paramString2;
    localc.l = paramString1;
    return localc;
  }

  private void a(String paramString1, String paramString2)
  {
    a.a().a(paramString1, paramString2);
  }

  private boolean a()
  {
    int i = 1;
    String[] arrayOfString = l.c(com.netease.b.a.d.h().a(), this.l, 4);
    if ((arrayOfString != null) && (arrayOfString.length == 2) && (!i.e(arrayOfString[0])) && (!i.e(arrayOfString[i])))
      a(arrayOfString[0], arrayOfString[i]);
    while (true)
    {
      return i;
      i = 0;
    }
  }

  private com.netease.b.b.e.g b(String paramString)
  {
    Object localObject = null;
    com.netease.b.b.e.g localg = new com.netease.b.b.e.g(4);
    try
    {
      localg.a(com.netease.c.b.c(new JSONObject(paramString).optString("id")));
      if ((localg != null) && (i.e(localg.b())))
        return localObject;
    }
    catch (JSONException localJSONException)
    {
      while (true)
      {
        localJSONException.printStackTrace();
        localg = null;
        continue;
        localObject = localg;
      }
    }
  }

  private m b(String paramString1, String paramString2)
  {
    com.netease.c.b.c localc;
    if (!i.e(paramString2))
    {
      String str2 = a.a().a("/statuses/upload.json");
      try
      {
        String str3 = URLEncoder.encode(paramString1, "UTF-8");
        Hashtable localHashtable2 = new Hashtable();
        localHashtable2.put("status", str3);
        ArrayList localArrayList = new ArrayList();
        localArrayList.add(new com.netease.a.b.g("status", str3, "UTF-8"));
        localArrayList.add(new com.netease.a.b.b("pic", new File(paramString2)));
        com.netease.a.b.a[] arrayOfa = new com.netease.a.b.a[localArrayList.size()];
        localArrayList.toArray(arrayOfa);
        h localh = new h(arrayOfa);
        localc = a.a().b().a(com.netease.framework.a.b.b, str2, localHashtable2, localh);
        localc.a(1);
      }
      catch (UnsupportedEncodingException localUnsupportedEncodingException)
      {
        localUnsupportedEncodingException.printStackTrace();
        localc = null;
      }
      catch (FileNotFoundException localFileNotFoundException)
      {
        localFileNotFoundException.printStackTrace();
        localc = null;
      }
    }
    else
    {
      Hashtable localHashtable1 = new Hashtable();
      String str1 = a.a().a("/statuses/update.json");
      localHashtable1.put("status", paramString1);
      localc = a.a().b().a(com.netease.framework.a.b.b, str1, localHashtable1);
      localc.a(true);
    }
    return localc;
  }

  public void a(int paramInt, String paramString)
  {
    f localf = a.a().a(paramInt, paramString);
    d(localf.h, localf);
  }

  public void a(String paramString)
  {
    Object localObject;
    switch (n())
    {
    default:
      localObject = null;
      if (o())
        break;
      if (localObject != null)
        c(0, localObject);
    case 4097:
    case 4098:
    }
    while (true)
    {
      return;
      localObject = b(paramString);
      break;
      d(-1, null);
    }
  }

  public void c()
  {
    if (!a())
    {
      d(-2, null);
      com.netease.g.b.d("***********", "Error  withou token & secret to send blog");
    }
    while (true)
    {
      return;
      switch (n())
      {
      default:
      case 4097:
      case 4098:
      }
      while (true)
      {
        if ((this.m == null) || (o()))
          break label92;
        a(this.m);
        break;
        this.m = b(this.j, this.k);
      }
      label92: d(-4, null);
      h();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.b.b.c
 * JD-Core Version:    0.6.0
 */